<template>
	<view class="bg">
		
		<view class="order-s">
			<view class="order-con" >
				<view class="order-text">订单状态：</view>
				<view class="order-status">{{Datas.status_text}}</view>
			</view>
			<!-- 个人信息 -->
			<view class="person">
				<view class="personal">
					<view class="pers">
						<view class="name">{{Datas.r_name}}</view>
						<view class="phone">{{Datas.tel_number}}</view>
					</view>
					<view class="addr">
						<image src="http://yunzhidun.oss-cn-beijing.aliyuncs.com/weixin/static/shop/location.png" mode="widthFix" class="locat"></image>
						<view class="address">{{Datas.province_name+Datas.city_name+Datas.county_name+Datas.detail_info}}</view>
					</view>
				</view>
				<!-- <image src="http://yunzhidun.oss-cn-beijing.aliyuncs.com/weixin/static/equipment/arrow.png" mode="widthFix" class="icon"></image> -->
			</view>
			
		</view>
		
		<view class="goods-item">
			<view class="goods-content" >
				<image class="goods-img" :src=Datas.goods.image mode="widthFix"></image>
				<view class="goods-text">
					<view class="goods-title">{{Datas.goods.title}}</view>
					<view class="goods-des">{{Datas.goods.content}}</view>
					<view class="goods-n">
						<view class="goods-price">￥{{Datas.goods.price}}</view>
						<view class="goods-num">X{{Datas.number}}</view>
					</view>
				</view>
			</view>
		
		
			<view class="dprice">
				<view class="price">
					<view class="price-text">商品总价</view>
					<view class="price-num">￥{{Datas.goods.price*Datas.number}}</view>
				</view>
				
			</view>
			
			<view class="price-re">
				<view class="price-retext">实付款</view>
				<view class="price-mon">￥{{Datas.goods.price*Datas.number}}</view>
			</view>
			
		</view>
		
		<view class="order-item">
			<view class="order-t" >
				<view class="ico"></view>
				<view class="order-text">订单信息</view>
			</view>
			<view class="order-content" >
				<view class="order-ct1">
					<view class="o-time">订单编号</view>
					<view class="order-time">{{Datas.order_no}}</view>
					<view class="cp" @tap="copyOrder">复制</view>
				</view>
				<view class="order-ct">
					<view class="o-time">创建时间</view>
					<view class="order-time">{{Datas.buy_time}}</view>
				</view>
				<view class="order-ct">
					<view class="o-time">付款时间</view>
					<view class="order-time">{{Datas.pay_time}}</view>
				</view>

				
			</view>
		</view>
		
	</view>
</template>

<script>
	var _self;
	export default {
		data() {
			return {
				page:1,
				Datas:[],
				goods:[],
				index:0,
				pay_time:'',
			}
		},
		onLoad(options) {
			console.log(options)
			// this.nos = options.orderNo
			this.status = options.status
			this.index = options.index
			_self = this;
			this.getOrder()
		},
		methods: {
			getOrder(){
				let userinfo = uni.getStorageSync('userinfo');
				uni.showLoading({
					title:"加载中"
				},2000)
				this.$api.interfaceApi('getOrder')({
					'uid':userinfo.id,
					'page':1,
					'status':this.status
				}).then(res=>{
					if(res.code == 200){
						this.Datas = res.data.list[this.index]
						console.log(this.Datas)
						this.Datas.pay_time = res.data.list[this.index].pay_time
						// console.log(this.Datas.pay_time)
						if(this.Datas.pay_time =='1970-01-01 08:00:00'){
							this.Datas.pay_time ='--';
						}
					}
					uni.hideLoading()
				})
			},
			copyOrder(){
				uni.setClipboardData({
					data:this.Datas.order_no,
					success:function(){
						uni.showToast({
							title:'编号已复制',
							icon:'none'
						});
					}
				})
			},
		}
	}
</script>

<style>
	@import url("orderDetails.css");
</style>
